<?php require ('setcookie.html'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html lang="de">
<head>
    <title>MP3 Vokabeltrainer mit gratis MP3 Vokabeln - Vokabelboxen</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="description" content="MP3 Vokabeln online mit dem MP3 Vokabeltrainer lernen - Englisch, Spanisch und Russisch kostenlos zum Download für den MP3 Player - Vokabelboxen organisieren" />
    <meta name="language" content="de" />
    <link href="style.css" type="text/css" rel="stylesheet" />
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
    <script language="JavaScript">function sprung(ziel) {window.location.href=ziel;}</script>
    <script type="text/javascript">
        <!--
        function test(state){
        var checkboxes=document.getElementsByName('chosen_words[]');
        for(var n=0;n<checkboxes.length;n++){
        checkboxes[n].checked=state;
        }
        }
        -->
    </script>
	<script language="JavaScript" type="text/javascript">
		<!--
		function selectbox ( selectedtype ) {
		document.supportform.supporttype.value = selectedtype ;
		document.supportform.submit() ;
		}
		-->
	</script>
</head>

<body id="trainer">

<?php
$_SESSION['logini'] = isset($_SESSION['logini']) ? $_SESSION['logini'] : false;
//$_SESSION['actbox'] = isset($_SESSION['actbox']) ? $_SESSION['actbox'] : false;
// read configuration
require ('konfiguration.html');
// read user-data
require ('nutzer.html');
// read header
$link = "vokabelboxen.html";
$langen = 'word-boxes.html';
$langes = 'cajas-vocablos.html';
$langru = 'word-boxes.html';
require ('kopf.html');
// <!-- horizontal column -->
echo '<div>';
require ('horizontal.html');
echo '</div>';
// <!-- Left Column -->
echo '<div id="left_col">';
require ('vertikal.html');
echo '</div>';

// <!-- Content -->
echo '<div id="content4">';
echo '<div id="block14">';

// if new password, request for change of password
if ( $newpass == 1 )
{
$passwo = isset($_REQUEST['passwo']) ? $_REQUEST['passwo'] : '1';
$passwo1 = isset($_REQUEST['passwo1']) ? $_REQUEST['passwo1'] : '1';
$passwo2 = isset($_REQUEST['passwo2']) ? $_REQUEST['passwo2'] : '1';
$ok='';
require_once ('neues-passwort.html');
}
else {
// initialize variables
$customerid = $_SESSION['customerid'];
if ( $_SESSION['langpair'] == '' ) { $langpair = '0'; } else { $langpair = $_SESSION['langpair']; }
$change_new = isset($_REQUEST['change_new']) ? $_REQUEST['change_new'] : '';
$change_old = isset($_REQUEST['change_old']) ? $_REQUEST['change_old'] : '';
if ( $change_new <> '' ) { require_once ('newlang.html'); }
if ( $change_old <> '' ) { require_once ('oldlang.html'); }
$action = '';
$chosen_words = isset($_REQUEST['chosen_words']) ? $_REQUEST['chosen_words'] : array();
$wordbox_new = isset($_REQUEST['wordbox_new']) ? $_REQUEST['wordbox_new'] : '';
$checked = isset($_REQUEST['savechecked']) ? $_REQUEST['savechecked'] : 'init';
$boxbefore = isset($_REQUEST['boxbefore']) ? $_REQUEST['boxbefore'] : 0;
$checked = isset($_REQUEST['supporttype']) ? $_REQUEST['supporttype'] : $checked;

if ( $checked == 'wordbox1' ) { $_SESSION['actbox'] = 1; $sql = "SELECT * FROM wordbox0 where boxid = 1 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; }
if ( $checked == 'wordbox2' ) { $_SESSION['actbox'] = 2; $sql = "SELECT * FROM wordbox0 where boxid = 2 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; }
if ( $checked == 'wordbox3' ) { $_SESSION['actbox'] = 3; $sql = "SELECT * FROM wordbox0 where boxid = 3 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; }
if ( $checked == 'wordbox4' ) { $_SESSION['actbox'] = 4; $sql = "SELECT * FROM wordbox0 where boxid = 4 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; }
if ( $checked == 'wordbox5' ) { $_SESSION['actbox'] = 5; $sql = "SELECT * FROM wordbox0 where boxid = 5 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; }
if ( $checked == 'wordbox6' ) { $_SESSION['actbox'] = 6; $sql = "SELECT * FROM wordbox0 where boxid = 6 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; }

if ( $wordbox_new <> '' )  { $action = 'sortvoc'; }
if (isset($_REQUEST['delete_x']))   { $action = 'delvoc'; }
if (isset($_REQUEST['sortback_x']))   { $action = 'sortback'; }

if (isset($_REQUEST['submit1_x'])) { $_SESSION['actbox'] = 1; $sql = "SELECT * FROM wordbox0 where boxid = 1 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; $checked = 'wordbox1'; $action = ''; }
if (isset($_REQUEST['submit2_x'])) { $_SESSION['actbox'] = 2; $sql = "SELECT * FROM wordbox0 where boxid = 2 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; $checked = 'wordbox2'; $action = ''; }
if (isset($_REQUEST['submit3_x'])) { $_SESSION['actbox'] = 3; $sql = "SELECT * FROM wordbox0 where boxid = 3 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; $checked = 'wordbox3'; $action = ''; }
if (isset($_REQUEST['submit4_x'])) { $_SESSION['actbox'] = 4; $sql = "SELECT * FROM wordbox0 where boxid = 4 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; $checked = 'wordbox4'; $action = ''; }
if (isset($_REQUEST['submit5_x'])) { $_SESSION['actbox'] = 5; $sql = "SELECT * FROM wordbox0 where boxid = 5 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; $checked = 'wordbox5'; $action = ''; }
if (isset($_REQUEST['submit6_x'])) { $_SESSION['actbox'] = 6; $sql = "SELECT * FROM wordbox0 where boxid = 6 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; $checked = 'wordbox6'; $action = ''; }

if (isset($_REQUEST['go_x'])) { $checked = ''; $_SESSION['actbox'] = 0; }
if ( $_SESSION['actbox'] == 0 ) { $sql = "SELECT * FROM wordbox0 where lastdownload <> 0 and customerid =". $customerid . " and langpairid =". $langpair . " order by 1word,2word,3word"; }


// execute function: show buttons for wordboxes 
switch ( $action ) {
  case 'sortvoc' :  sortvoc();
  case 'delvoc' : delvoc();
  case 'sortback' :  sortback();
  $db_res = mysql_query( $sql );
  if ( ! $db_res ) { die('Error query2: ' . mysql_error()); }
  }
if ($checked == 'init') { initdisplay(); } else 
{ 
// request for login
if ($_SESSION['logini']== false) {
    require_once ('loginformular.html'); 
} else {
// DB Query
$db_res = mysql_query( $sql );
if ( ! $db_res ) { die('Error query1: ' . mysql_error()); }
show_dialog(); }
}
}

// ----------------------- Functions --------------------------------------------------------------------------------------------

function show_dialog() {

  global $checked,$db_res,$customerid;

  echo '<form name="xxx" action="vokabelboxen.html" method="POST">';

    if ( $checked == '' ) { echo '<h2>Zuletzt gelernte Vokabeln</h2>'; }
	else { echo '<h2>Vokabelboxen</h2>'; }

    // Sprachen auslesen
    $sql2 = "SELECT can,learn,langpair FROM settings where customerid = '$customerid'";
    mysql_query('SET NAMES utf8');
    mysql_query('SET CHARACTER SET utf8');
    $db_sel2 = mysql_query( $sql2 );
    if ( ! $db_sel2 ) { die('Error query3: ' . mysql_error()); }
    while ($row = mysql_fetch_array( $db_sel2, MYSQL_ASSOC)) {
    if ( $row['can'] == '' or $row['learn'] == '' or $row['can'] == '-' or $row['learn'] == '-' )
    {
        echo '<br />';
        $missinglangpair = '1';
        require_once ('sprache-waehlen.html');
    }
    else
    {
    echo '<div id="block19">';
    echo '<br />';

    print '<div class="fleft">';
    if ( $checked == 'wordbox1' ) {
    echo '<input type="image" src="bilder/buttons/nbox1.gif" name="submit1" alt="Box 1" title=" Box 1 " class="button7" />';
    } else {
    echo '<input type="image" src="bilder/buttons/nbox1b.gif" name="submit1" alt="Box 1" title=" Box 1 " class="button7" />';
    }
    if ( $checked == 'wordbox2' ) {
    echo '<input type="image" src="bilder/buttons/nbox2.gif" name="submit2" alt="Box 2" title=" Box 2 " class="button7" />';
    } else {
    echo '<input type="image" src="bilder/buttons/nbox2b.gif" name="submit2" alt="Box 2" title=" Box 2 " class="button7" />';
    }
    if ( $checked == 'wordbox3' ) {
    echo '<input type="image" src="bilder/buttons/nbox3.gif" name="submit3" alt="Box 3" title=" Box 3 " class="button7" />';
    } else {
    echo '<input type="image" src="bilder/buttons/nbox3b.gif" name="submit3" alt="Box 3" title=" Box 3 " class="button7" />';
    }
    if ( $checked == 'wordbox4' ) {
    echo '<input type="image" src="bilder/buttons/nbox4.gif" name="submit4" alt="Box 4" title=" Box 4 " class="button7" />';
    } else {
    echo '<input type="image" src="bilder/buttons/nbox4b.gif" name="submit4" alt="Box 4" title=" Box 4 " class="button7" />';
    }
    if ( $checked == 'wordbox5' ) {
    echo '<input type="image" src="bilder/buttons/nbox5.gif" name="submit5" alt="Box 5" title=" Box 5 " class="button7" />';
    } else {
    echo '<input type="image" src="bilder/buttons/nbox5b.gif" name="submit5" alt="Box 5" title=" Box 5 " class="button7" />';
    }
    if ( $checked == 'wordbox6' ) {
    echo '<input type="image" src="bilder/buttons/nbox6.gif" name="submit6" alt="Box 6" title=" Box 6 " class="button7" />';
    } else {
    echo '<input type="image" src="bilder/buttons/nbox6b.gif" name="submit6" alt="Box 6" title=" Box 6 " class="button7" />';
    }
    print '</div>';   

    if ( $checked <> '' ) { 
    print '<div class="textsmall2">';
    print '   <div class="button4" >';
    print '      <span>Zuletzt gelernte Vokabeln umsortieren:&nbsp;</span>';
    print '      <input type="image" src="bilder/buttons/go.png" name="go" alt="Go" title=" Go " class="" />';
    print '   </div>';
    print '</div>'; }  
	
	
    echo '<br /><br />';

    echo '<table border="0" style="border-collapse:collapse">';
    echo '<tr>';    
    echo '<td>';
    echo '<input type="checkbox" name="checkall" value="1" onclick="test(this.checked)" />';
    echo '</td>';
    echo '<td class="textmedium" >';
    echo '&nbsp;&nbsp;alle';
    echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    echo '</td>';

    // Show listbox with wordboxes
    echo '<td>';
    echo '<select name="wordbox_new" onchange=xxx.submit()>';
        echo '<option value="" >umsortieren nach&nbsp;</option>';
        echo '<option value="1" >Box 1&nbsp;</option>';
        echo '<option value="2" >Box 2&nbsp;</option>';
        echo '<option value="3" >Box 3&nbsp;</option>';
        echo '<option value="4" >Box 4&nbsp;</option>';
        echo '<option value="5" >Box 5&nbsp;</option>';
        echo '<option value="6" >Box 6&nbsp;</option>';
    echo '</select>';
    echo '</td>';
    echo '<td>';
    echo '<input type="image" src="bilder/buttons/loeschen.png" class="button4" name="delete" alt="L&ouml;schen" title=" L&ouml;schen " />';
    echo '<input type="image" src="bilder/buttons/zuruecksortieren.png" class="button4" name="sortback" alt="Zurücksortieren" title=" Zurücksortieren " />';
    echo '<a href="download.html">';
	
    if ( $checked <> '' ) { 
    echo '<input type="image" src="bilder/buttons/download.png" class="button4" name="download" alt="Download" title=" Download " />';
    echo '</a>';
    echo '<a href="neue-vokabelliste.html?box='. $checked . '">';
	echo '<input type="image" src="bilder/buttons/vokabelliste.png" class="button4" name="wordslist" alt="Vokabelliste" title=" Vokabelliste " />';
    echo '</a>'; } else {
    echo '<input type="image" src="bilder/buttons/downloadb.png" class="button4" name="download" alt="Download" title=" Download " />';
    echo '</a>';
    echo '<a href="neue-vokabelliste.html?box='. $checked . '">';
	echo '<input type="image" src="bilder/buttons/vokabellisteb.png" class="button4" name="wordslist" alt="Vokabelliste" title=" Vokabelliste " />';
    echo '</a>'; }
	echo '<input type=hidden name=savechecked value="'. $checked . '" />';
    echo '</td>';
    echo '</tr>';
    echo '</table>';
    echo '<br />';

    
    //surrounding div with pseudo-format for giving parent element to any child element with
	//formatted position-attribute
	//-> an "absolute" positioning is relative to its first formatted parent window
    print '<div style="position:relative;top:1px;">';
	//this div is a layer above all text-> prevents copying
	print '<div style="z-index:100;left:15px;top:10px;width:720px;height:490px;position:relative"></div>';
	//needs to have absolute positioning, else if it will go visibly under the div
	print '<table border="0" style="border-collapse:collapse;left:0px;top:0px;position:absolute">';
	// headline
	echo '<tr class="bghead">';
    echo "<td class='check7'>&nbsp;</td>";
    echo "<td class='table8'>Ausgangswörter</td>";
    echo "<td class='table9'>Übersetzungen</td>"; 
    echo "<td class='table10'>Vorher in Box&nbsp;</td>"; 
    echo '</tr>';
    echo '</table>';
    
    $h = 0;
    
    echo '<table border="0" style="border-collapse:collapse;left:0px;top:20px;position:absolute">';
    while ($row = mysql_fetch_array( $db_res, MYSQL_ASSOC)) {

        $key = $row['customerid'] . ',' . $row['boxid'] . ',' . $row['langpairid'] . ',' . $row['langid'] . ',' . $row['1word'] . ',' . $row['2word'] . ',' . $row['3word'] . ',' . $row['word1'] . ',' . $row['word2'] . ',' . $row['word3'] . ',' . $row['timestamp'] . ',' . $row['boxbefore'];

        if ( $h == 0 ) { echo '<tr>'; } else { echo '<tr class="bg">'; }
            echo "<td class='check6'><input type=Checkbox name=chosen_words[] value='". $key ."' /></td>";
            echo "<td class='table6'>". $row['1word'] . "</td>";
      if ( $row['2word'] == '' )
        { echo "<td class='table6'>&nbsp;-</td>"; }
      else
        { echo "<td class='table6'>". $row['2word'] . "</td>"; }
      if ( $row['3word'] == '' )
        { echo "<td class='table6'>&nbsp;-</td>"; }
      else
        { echo "<td class='table6'>". $row['3word'] . "</td>"; }

      echo "<td class='table6'>". $row['word1'] . "</td>";
      if ( $row['word2'] == '' )
        { echo "<td class='table6'>&nbsp;-</td>"; }
      else
        { echo "<td class='table6'>". $row['word2'] . "</td>"; }
      if ( $row['word3'] == '' )
        { echo "<td class='table6'>&nbsp;-</td>"; }
      else
        { echo "<td class='table6'>". $row['word3'] . "</td>"; }
	  if ( $row['boxbefore'] == 0 ) 
	    { echo "<td class='table7'>NEU&nbsp;</td>"; }
	  else
		{ echo "<td class='table7'>" . $row['boxbefore'] . "&nbsp;</td>"; }
        // save boxbefore - value
        echo "<input type='hidden' name='boxbefore' value='". $row['boxid'] . "' />";

        echo '</tr>';
        if ( $h == 1 ) { $h = -1; }
        $h = $h + 1;
    }
    echo '</table></div>';
    
    echo '</div>';


    mysql_free_result( $db_res );
    } }
	echo '</form>';
}


// change wordbox of chosen words
function sortvoc() {
  global $chosen_words, $wordbox_new, $key, $boxbefore ;

	 for( $i=0; $i<count($chosen_words); $i++ ) {
		
		// write parts of checkbox-string in $key-array 
		$str = $chosen_words[$i];

        $key = explode(",",$str); 

        // update chosen words
		$sql1 = " update wordbox0 set boxid = ". $wordbox_new .", notselected = 0, boxbefore =". $boxbefore . ",";
		$sql1 .= " timestamp = current_timestamp ";
        $sql1 .= " where customerid = ". $key[0] ." ";
		$sql1 .= " and boxid = ". $key[1] ." and langpairid = ". $key[2] ." and langid = ". $key[3] ." ";
		$sql1 .= " and 1word = '". $key[4] ."' and word1 = '". $key[7] ."' ";
        $db_sel = mysql_query( $sql1 );
        if ( ! $db_sel )
            { die('Error query4: ' . mysql_error()); }
        }
} 

function delvoc() {

    global $chosen_words, $key ;

	for( $i=0; $i<count($chosen_words); $i++ ) {

		// write parts of checkbox-string in $key-array
		$str = $chosen_words[$i];

        $key = explode(",",$str);

        // delete chosen words
		$sql1 = " delete from wordbox0 where ";
        $sql1 .= " customerid = ". $key[0] ." and ";
		$sql1 .= " boxid = ". $key[1] . " and langpairid = ". $key[2] . " and langid = ". $key[3] . " ";
		$sql1 .= " and 1word = '". $key[4] . "' and word1 = '". $key[7] . "' ";

		$db_del = mysql_query( $sql1 );
        if ( ! $db_del )
        { die('Error query5: ' . mysql_error()); }
    }
}

// sort back chosen words to box before
function sortback() {
  global $chosen_words, $key;

	 for( $i=0; $i<count($chosen_words); $i++ ) {
		
		// write parts of checkbox-string in $key-array 
		$str = $chosen_words[$i];

        $key = explode(",",$str); 
		
		// if boxbefore was not 1-6, then set to current boxid 
		$nextbox = $key[11];
		if ( $key[11] == 0 ) { $nextbox = $key[1]; }  
		
        // update chosen words
		$sql1 = " update wordbox0 set boxid = ". $nextbox .", notselected = 0,";
		$sql1 .= " timestamp = current_timestamp, lastdownload = 0 ";
        $sql1 .= " where customerid = ". $key[0] ." ";
		$sql1 .= " and boxid = ". $key[1] ." and langpairid = ". $key[2] ." and langid = ". $key[3] ." ";
		$sql1 .= " and 1word = '". $key[4] ."' and word1 = '". $key[7] ."' ";
		$db_sel = mysql_query( $sql1 );
        if ( ! $db_sel )
            { die('Error query6: ' . mysql_error()); }
        }
} 

function initdisplay() {

  global $customerid, $langpair;

  echo '<form name="supportform" method="post" action="vokabelboxen.html">';

    echo '<h2>Vokabelboxen</h2>'; 

    echo '<br />';
    echo '<div class="content_frame">';
    print "<div style='font-size:16px;'>Wähle eine Vokabelbox aus:</div><br><br>";
    echo '<div class="left10">&nbsp;</div>';

	$box1 = "'wordbox1'";
	$box2 = "'wordbox2'";
	$box3 = "'wordbox3'";
	$box4 = "'wordbox4'";
	$box5 = "'wordbox5'";
	$box6 = "'wordbox6'";
	
	echo '<input type="hidden" name="supporttype" />';
	echo '<div class="marginright5" ><a href="javascript:selectbox('. $box1 . ')">Box 1</a></div>';
	echo '<div class="marginright5" ><a href="javascript:selectbox('. $box2 . ')">Box 2</a></div>';
	echo '<div class="marginright5" ><a href="javascript:selectbox('. $box3 . ')">Box 3</a></div>';
	echo '<div class="marginright5" ><a href="javascript:selectbox('. $box4 . ')">Box 4</a></div>';
	echo '<div class="marginright5" ><a href="javascript:selectbox('. $box5 . ')">Box 5</a></div>';
	echo '<div class="marginright5" ><a href="javascript:selectbox('. $box6 . ')">Box 6</a></div>';

    echo '<div class="left10">&nbsp;</div>';
    echo '<br /><br />';

	if ($_SESSION['logini']== true) {

    // Sprachen auslesen
    $sql2 = "SELECT can,learn,langpair FROM settings where customerid = '$customerid'";
    mysql_query('SET NAMES utf8');
    mysql_query('SET CHARACTER SET utf8');
    $db_sel2 = mysql_query( $sql2 );
    if ( ! $db_sel2 ) { die('Error query3: ' . mysql_error()); }
    while ($row = mysql_fetch_array( $db_sel2, MYSQL_ASSOC)) {
    if ( $row['can'] == '' or $row['learn'] == '' or $row['can'] == '-' or $row['learn'] == '-' )
    {
        echo '<br />';
        $missinglangpair = '1';
        require_once ('sprache-waehlen.html');
    }
    else
    {

    // Read quantities of words
    $sql11 = "SELECT COUNT(*) FROM wordbox0 where customerid = '$customerid' and boxid = 1 and langpairid =". $langpair;
    $sql12 = "SELECT COUNT(*) FROM wordbox0 where customerid = '$customerid' and boxid = 2 and langpairid =". $langpair;
    $sql13 = "SELECT COUNT(*) FROM wordbox0 where customerid = '$customerid' and boxid = 3 and langpairid =". $langpair;
    $sql14 = "SELECT COUNT(*) FROM wordbox0 where customerid = '$customerid' and boxid = 4 and langpairid =". $langpair;
    $sql15 = "SELECT COUNT(*) FROM wordbox0 where customerid = '$customerid' and boxid = 5 and langpairid =". $langpair;
    $sql16 = "SELECT COUNT(*) FROM wordbox0 where customerid = '$customerid' and boxid = 6 and langpairid =". $langpair;

    $db_sel11 = mysql_query( $sql11 ) OR die(mysql_error());
    $db_sel12 = mysql_query( $sql12 ) OR die(mysql_error());
    $db_sel13 = mysql_query( $sql13 ) OR die(mysql_error());
    $db_sel14 = mysql_query( $sql14 ) OR die(mysql_error());
    $db_sel15 = mysql_query( $sql15 ) OR die(mysql_error());
    $db_sel16 = mysql_query( $sql16 ) OR die(mysql_error());

	$result11 = mysql_fetch_array($db_sel11);     
	$result12 = mysql_fetch_array($db_sel12);     
	$result13 = mysql_fetch_array($db_sel13);     
	$result14 = mysql_fetch_array($db_sel14);     
	$result15 = mysql_fetch_array($db_sel15);     
	$result16 = mysql_fetch_array($db_sel16);     

	// display images of boxes
	displaybox($result11[0],1);
	displaybox($result12[0],2);
	displaybox($result13[0],3);
	displaybox($result14[0],4);
	displaybox($result15[0],5);
	displaybox($result16[0],6);

	// display quantities of words
    echo '<div class="left10">&nbsp;</div>';
	echo '<div class="marginright5" >'. $result11[0] . '</div>';
	echo '<div class="marginright5" >'. $result12[0] . '</div>';
	echo '<div class="marginright5" >'. $result13[0] . '</div>';
	echo '<div class="marginright5" >'. $result14[0] . '</div>';
	echo '<div class="marginright5" >'. $result15[0] . '</div>';
	echo '<div class="marginright5" >'. $result16[0] . '</div><br /><br /><br /><br />';

    echo '<br /><br />';
    echo '<br /><br />';

    print "<div style='font-size:16px;'>Zuletzt gelernte Vokabeln umsortieren:&nbsp;&nbsp;";
    print '<input type="image" src="bilder/buttons/go.png" name="go" alt="Go" title=" Go " class="" /></div>';
    echo '<div class="left10">&nbsp;</div>';
 	}}} else {
    echo '<input type="image" src="bilder/buttons/box.png" name="submit1" alt="Box 1" title=" Box 1 " class="marginright5" />';
    echo '<input type="image" src="bilder/buttons/box.png" name="submit2" alt="Box 2" title=" Box 2 " class="marginright5" />';
    echo '<input type="image" src="bilder/buttons/box.png" name="submit3" alt="Box 3" title=" Box 3 " class="marginright5" />';
    echo '<input type="image" src="bilder/buttons/box.png" name="submit4" alt="Box 4" title=" Box 4 " class="marginright5" />';
    echo '<input type="image" src="bilder/buttons/box.png" name="submit5" alt="Box 5" title=" Box 5 " class="marginright5" />';
    echo '<input type="image" src="bilder/buttons/box.png" name="submit6" alt="Box 6" title=" Box 6 " class="marginright5" />';
    echo '<br><br><br><br /><br /><br />';
	}

    echo '</div>';

    echo '<div class="content_frame5">';
    print '<h3 style="color:#BE1C58;">Tipp:</h3><br>';
    print '<h4 style="font-size:15px;">Lernen nach dem Karteikarten-Prinzip</h4><br>';
	print 'Wir empfehlen, die Vokabeln nach dem <b>persönlichen Schwierigkeitsgrad</b> zu '; 
	print 'sortieren, d.h. in Box 1 kommen neue, noch ungelernte Vokabeln, in Box 6 diejenigen ';
	print 'Vokabeln, die man bereits sehr gut gelernt hat.'; 
	print '<br><br>';
    echo '<div align="center"><input type="image" src="bilder/box_dec.png" name="submit" alt="Karteikarten-Prinzip" title=" Karteikarten-Prinzip " class="" />';
    echo '</div>';
	print '<br><br>';
	print 'Nun können Vokabeln aus einzelnen Vokabelboxen <b>heruntergeladen</b> werden. Nach dem Lernen '; 
	print 'können die Vokabeln <b>umsortiert</b> werden. Wenn man sich die Vokabeln durch das Lernen '; 
	print 'bereits besser merken kann, können sie weiter nach rechts rücken:';	
	print '<br><br>';
    echo '<div align="center"><input type="image" src="bilder/box_dec2.png" name="submit" alt="Karteikarten-Prinzip" title=" Karteikarten-Prinzip " class="" />';
    echo '</div>';
	print '<br><br>';
    echo 'Im optimalen Fall sind am Ende alle Vokabeln in Box 6:';
	print '<br><br>';
    echo '<div align="center"><input type="image" src="bilder/box_dec4.png" name="submit" alt="Karteikarten-Prinzip" title=" Karteikarten-Prinzip " class="" />';
    echo '</div>';
	
	
    echo '</div>';

	
	echo '</form>';
}	

function displaybox($variable,$i)
{
   if( $variable == 0 ) {
    echo '<input type="image" src="bilder/buttons/box.png" name="submit'. $i . '" alt="Box '. $i . '" title=" Box '. $i . ' " class="marginright5" />';
	}
	else if( 1<=$variable && $variable<=9 ) {
    echo '<input type="image" src="bilder/buttons/box01.png" name="submit'. $i . '" alt="Box '. $i . '" title=" Box '. $i . ' " class="marginright5" />';
	}
	else if( 10<=$variable && $variable<=49 ) {
    echo '<input type="image" src="bilder/buttons/box10.png" name="submit'. $i . '" alt="Box '. $i . '" title=" Box '. $i . ' " class="marginright5" />';
	}
	else if( 50<=$variable && $variable<=99 ) {
    echo '<input type="image" src="bilder/buttons/box50.png" name="submit'. $i . '" alt="Box '. $i . '" title=" Box '. $i . ' " class="marginright5" />';
	}
	else if( 100<=$variable && $variable<=199 ) {
    echo '<input type="image" src="bilder/buttons/box100.png" name="submit'. $i . '" alt="Box '. $i . '" title=" Box '. $i . ' " class="marginright5" />';
	}
	else if( 200<=$variable && $variable<=499 ) {
    echo '<input type="image" src="bilder/buttons/box200.png" name="submit'. $i . '" alt="Box '. $i . '" title=" Box '. $i . ' " class="marginright5" />';
	}
	else if( 500<=$variable && $variable<=999 ) {
    echo '<input type="image" src="bilder/buttons/box500.png" name="submit'. $i . '" alt="Box '. $i . '" title=" Box '. $i . ' " class="marginright5" />';
	}
	else {
    echo '<input type="image" src="bilder/buttons/box1000.png" name="submit'. $i . '" alt="Box '. $i . '" title=" Box '. $i . ' " class="marginright5" />';
	}
}

function mysql_query_secure($query)
{
   $result=mysql_query($query);
   if ( ! $result ) { die('Error query7: ' . mysql_error()); }
   return $result;
}

echo '</div>';
echo '</div>';
echo '<div id="adverts">';
echo '<div id="adbox"></div>';
echo '</div>';

require ('fuss.html');
?>

</body>
</html>